package com.tc.activiti.user.service.impl;

import com.tc.activiti.user.entity.SysRole;
import com.tc.activiti.user.entity.SysUser;
import com.tc.activiti.user.mapper.SysRoleMapper;
import com.tc.activiti.user.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zengqingfa
 * @date 2019/10/18 15:43
 * @description
 * @email zengqingfa_java@163.com
 */
@Service
public class RoleServiceImpl implements IRoleService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Override
    public int deleteByPrimaryKey(Long roleId) {
        return sysRoleMapper.deleteByPrimaryKey(roleId);
    }

    @Override
    public int insert(SysRole record) {
        return sysRoleMapper.insert(record);
    }

    @Override
    public int insertSelective(SysRole record) {
        return sysRoleMapper.insertSelective(record);
    }

    @Override
    public SysRole selectByPrimaryKey(Long roleId) {
        return sysRoleMapper.selectByPrimaryKey(roleId);
    }

    @Override
    public int updateByPrimaryKeySelective(SysRole record) {
        return sysRoleMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(SysRole record) {
        return sysRoleMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<SysRole> getGroupsByUserName(Long userId) {
        return sysRoleMapper.getGroupsByUserName(userId);
    }

    @Override
    public List<SysRole> findAll() {
        return  sysRoleMapper.findAll();
    }
}
